package com.haiberg.framework.om;

import java.sql.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="person", catalog="public")
public class Person implements java.io.Serializable  {
	private Long id;
	private String username;
	private String password;
	private String realname;
	private int age;
	private String sex;
	private String provience;
	private String city;
	private String county;
	private String village;
	private Date inserted;
	private String status; 
	
	//new add
	private String email;
	
	public Person(){}
	
	//@Id
	//@SequenceGenerator(name="record_id_seq",sequenceName="record_id_seq")
	//@GeneratedValue(strategy=GenerationType.SEQUENCE)   
	//@Column(name = "id", unique = true, nullable = false)
	
	@Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "func2")
    @SequenceGenerator(name = "func2", allocationSize=1, initialValue=1, sequenceName = "person_id_seq")
    @Column(name = "id")
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	@Column(name="username")
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}
	@Column(name="password")
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	@Column(name="real_name")
	public String getRealname() {
		return realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}
	@Column(name="age")
	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}
	
	@Column(name="provience")
	public String getProvience() {
		return provience;
	}

	public void setProvience(String provience) {
		this.provience = provience;
	}
	@Column(name="city")
	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}
	@Column(name="county")
	public String getCounty() {
		return county;
	}

	public void setCounty(String county) {
		this.county = county;
	}
	@Column(name="village")
	public String getVillage() {
		return village;
	}

	public void setVillage(String village) {
		this.village = village;
	}
	@Column(name="inserted")
	public Date getInserted() {
		return inserted;
	}

	public void setInserted(Date inserted) {
		this.inserted = inserted;
	}
	@Column(name="sex")
	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}
	@Column(name="status")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	@Column(name="email")
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
		
}
